<?php 
header("Content-type: text/html; charset=utf-8");
$conn = @mysql_connect( 'localhost','root','')
or die('数据库无法连接！');
mysql_set_charset('utf8');
@mysql_select_db('neu-video',$conn)
or die('数据库无法连接');
$sql ='select * from users';
$result = mysql_query($sql,$conn);
/*while ($result && ($row = mysql_fetch_assoc($result))!== FALSE) {
	echo $row ['uname'].'<br>';
}
*/
$users=fetch_array($result);
echo'<table border="1">';
echo'<tr>
<th>用户名</th>
<th>密码</th>
<th>性别</th>
<th>出生日期</th>
<th>爱好</th>
<th>学历</th>
<th>个人简介</th>
<th>照片</th>
</tr>';
foreach ($users as $one) {
echo'<tr>';
echo '<td>'.$one['uname'].'<br>'.'</td>';
echo '<td>'.$one['password'].'<br>'.'</td>';
if($one['gender']==1)
	{$sex='男';}
	else
		{$sex='女';}
echo '<td>'.$sex.'<br>'.'</td>';
echo '<td>'.$one['birthdiy'].'<br>'.'</td>';
echo '<td>'.$one['hobby'].'<br>'.'</td>';
echo '<td>'.$one['degree'].'<br>'.'</td>';
echo '<td>'.$one['intro'].'<br>'.'</td>';
echo '<td>'.$one['pic'].'<br>'.'</td>';
echo'</tr>';
}

function fetch_array($Results){
$arrs =array();
while ($Results && ($row = mysql_fetch_assoc($Results))!== FALSE){
$arrs[]=$row;
}
return $arrs;
}

 ?>}